﻿<?php

$obj=new mysql($config);


if(!empty($_POST)){
    $arr=array();
    $id=$_POST['id'];
    $arr['name']=$_POST['name'];
    $arr['pid']=$_POST['pid'];
    $arr['url']=$_POST['url'];
    $row=$obj->update($arr,array('id'=>$id),'author');
    if($row>0){
         echo "<script>alert('更新成功');</script>";
    }else{
         echo "<script>alert('更新失败');</script>";
    }
}




$id=$_GET['id'];

$sql="select * from `author` where id=$id";
$one=$obj->getOne($sql);

$sql1="select * from `author` where pid=0";
$date=$obj->getCondition($sql1);



require_once (VIEW_PATH.'admin/layout.html');

